<extend name="Public:common"/>	
<block name="content">
		<!--/sidebar-->
		<div class="main-wrap">

			<div class="crumb-wrap">
				<div class="crumb-list">
					<i class="icon-font"></i>
					<a href="__MODULE__/">首页</a>
					<span class="crumb-step">&gt;</span>
					<span class="crumb-name">管理权限列表</span>
				</div>
			</div>
			<div class="search-wrap">
			<div class="search-content">
				<form action="__MODULE__/Rbac/jurisdiction" method="get">
					<table class="search-tab">
						<tr>
							<th width="70">权限:</th>
							<td>
								<input class="common-text" placeholder="权限中文名" name="keyword"
									 type="text">
							</td>
							<td>
								<input class="btn btn-primary btn2" value="查询" type="submit">
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
			<div class="result-wrap">
				<form name="myform" id="myform" method="post">
					<div class="result-title">
						<div class="result-list">
							<a href="__MODULE__/Rbac/jurisdictionadd">
								<i class="icon-font"></i>
								添加权限节点
							</a>
							<a id="batchDel" href="javascript:delall(<{$p}>)">
								<i class="icon-font"></i>
								批量删除
							</a>
						</div>
					</div>
					<div class="result-content">
						<table class="result-tab" width="1125">
							<tr id='tr'>
								<th class="tc" width="30">
									<input  type="checkbox" class='chkall'  />
								</th>
								<th  width="30">ID</th>
								<th  >权限中文名</th>
								<!-- <th>权限英文名</th> -->
								<th>操作名</th>
								<th>级别</th>
								<th>父节点</th>
								<th>状态</th>
								<th width="7%">操作</th>
							</tr>
							<volist name='nlist' id='vo' empty='暂无数据'>
							<tr>
								<td class="tc">
									<input  value="<{$vo.id}>" type="checkbox" name='id' class='chk'>
								</td>
								<td><{$vo.id}></td>
								<td>
									<{$vo.title}>
								</td>
				<!-- 				<td>
									<{$vo.name}>
								</td> -->
								<td>
									<{$vo.name}>
								</td>
								<td>
									<{$vo.level}>
								</td>
								<td>
									<{$vo.pname}>
								</td>
								<td>
								<if condition='$vo["status"] eq 1'>
								<a href='javascript:;' onclick='status(0,this,<{$vo.id}>)'>开启</a>
								<else />
								<a href='javascript:;' onclick='status(1,this,<{$vo.id}>)'>关闭</a>
								</if>
								</td>
								<td>
									<a class="link-update" href="__MODULE__/Rbac/jurisdictionedit/id/<{$vo.id}>">编辑</a>
									<a class="link-del" href="javascript:del(<{$vo.id}>);">删除</a>
								</td>
							</tr>
							</volist>
							<tr>
							<td colspan='9'><div class="pages" ><{$showpage}></div></td>
							</tr>
						</table>
						
					</div>
				</form>
			</div>
		</div>
		<!--/main-->
	<script>
		//状态开关
		function status(n,e,id){
			if(e.innerHTML=='开启'){
				$(e).html("关闭");
			}else{
				$(e).html("开启");
			}
			$.post("__MODULE__/Rbac/status",{"n":n,"id":id});
		}
		//全选
		$('.chkall').click(function(){
			
			$(".chk").prop('checked',this.checked)
			
		})
		//单个删除
		function del(n){
			//删除 商品 漂亮的提示信息
			$.MsgBox.Confirm("删除提示", "您确认删除该帐号", function () { 
				//发送 当前商品的id 和当前用户帐号
				$.post("__MODULE__/Rbac/jurisdictiondel",{"id":n},function(d){
					
					$.MsgBox.Alert("删除提示", d.message);//删除后刷新本页
					// window.setTimeout("window.location='__CONTROLLER__/jurisdiction/p/"+p+".html'",1000);//1秒后 跳转
					location.reload();
				},"json");
			})
		}
		//多个删除
		function delall(){
			//删除 商品 漂亮的提示信息
			$.MsgBox.Confirm("删除提示", "您确认删除该帐号", function () { 
				var str = "";
				$(".chk:checked").each(function(i,e){
					str += $(e).val()+",";
				})
				if(str == ""){
					$.MsgBox.Alert("提示","<span style='color:red;'>未选择</span>");
					return;
				}
				//发送 当前商品的id 和当前用户帐号
				$.post("__MODULE__/Rbac/jurisdictiondel",{"id":str},function(d){
					$.MsgBox.Alert("删除提示", d.message);//删除后刷新本页
					location.reload();
				},"json");
				
			})
		}
		
			
	
	</script>
	</block>